package edu.westga.cs.recommender.model.datatypes;

import java.util.*;

/**
 * Stores a user's login, proper name, and preferences.
 * @author Brent W. Ezell
 *
 */
public class User {
	//Fields
	/**
	 * The login name of the user.
	 */
	private String login;
	/**
	 * The full name of the user.
	 */
	private String name;
	/**
	 * The user's linked profiles.
	 */
	private LinkedList<String> profiles;
	
	//Constructor
	/**
	 * Defines a user.
	 * @param login = The login name of the user.
	 * @param name = The name of the user.
	 * @param profiles = A list of profiles for the user.
	 */
	public User(String login, String name, LinkedList<String> profiles) {
		this.login = login;
		this.name = name;
		this.profiles = profiles;
	}
	
	//Methods
	/**
	 * Gets the user's login name.
	 * @return The login name.
	 */
	public String getLogin() {
		return this.login;
	}
	/**
	 * Gets the user's full name.
	 * @return The name.
	 */
	public String getName() {
		return this.name;
	}
	
	/**
	 * Gets the user's list of profiles.
	 * @return The user's list of profiles.
	 */
	public LinkedList<String> getProfiles() {
		LinkedList<String> secure = this.profiles;
		return secure;
	}
	
	/**
	 * Adds a new profile to the user's list of profiles.
	 * @param newProfile The profile to add.
	 */
	public void addProfile(String newPro) {
		this.profiles.add(newPro);
	}
	
	/**
	 * Removes a profile from the user's list of profiles.
	 * @param delProfile The profile to remove.
	 */
	public void removeProfile(String delProfile) {
		int killnum = this.profiles.indexOf(delProfile);
		this.profiles.remove(killnum);
	}
}